<form id="add-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
    <input type="hidden" class="form-control" name="row[order_id]" value="{$order.id}"/>

    <div class="form-group">
        <label for="c-local" class="control-label col-xs-12 col-sm-2">订单号：</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" data-rule="required" placeholder="请输入收货人" value="{$order.order_sn}" readonly/>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">客户:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[customer_id]', $customerLists, $order.customer_id, ['class'=>'form-control selectpicker', 'required'=>'', 'data-live-search'=>"true"])}
        </div>
    </div>

    <div class="form-group">
        <label for="c-local" class="control-label col-xs-12 col-sm-2">要求完工时间：</label>
        <div class="col-xs-12 col-sm-8">
            <input type="date" name="row[finish_time]" class="form-control" data-rule="required" placeholder="请输入完工时间" value="{$produce.finish_time}"/>
        </div>
    </div>


    <div class="form-group" id="product_json">
        <label class="control-label col-xs-12 col-sm-2">{:__('选择产品')}：</label>
        <div class="col-xs-12 col-sm-8">
            <table class="table table-responsive fieldlist" data-name="row[test]" data-template="testtpl" data-tag="tr">
                   <tr style="text-align: center">
                <td>名称</td>
                <td>规格</td>
                <td>数量</td>
                <td>尺寸要求/图号</td>
                <td>料工</td>
                <td>车工</td>
                <td>钻工</td>
                <td>料/检/其他要求</td>
                       </tr>
                   <tr>
                       <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a></td>
                   </tr>
                <!--定义模板，初始化内容-->
                   <textarea name="row[test]" class="form-control hide" cols="30" rows="8">{$produce.detail_json}</textarea>
            </table>
        </div>

        <!--定义模板，模板语法使用Art-Template模板语法-->
        <script type="text/html" id="testtpl">
            <tr class="form-inline" style="text-align: center">
                <td><input type="text" name="row[<%=name%>][<%=index%>][product_id]" class="form-control selectpage" data-source="select/getProduct" data-field="name" value="<%=row['product_id']%>" size="20" ></td>
                <td><input type="text" name="row[<%=name%>][<%=index%>][product_spec]" class="form-control" value="<%=row['product_spec']%>" size="20"></td>
                <td><input type="number" name="row[<%=name%>][<%=index%>][number]" class="form-control" value="<%=row['number']%>" size="5"></td>
                <td><textarea name="row[<%=name%>][<%=index%>][product_standard]" class="form-control"><%=row['product_standard']%></textarea>
                <td><input type="text" name="row[<%=name%>][<%=index%>][material_worker]" class="form-control" value="<%=row['material_worker']%>" size="20"></td>
                <td><input type="text" name="row[<%=name%>][<%=index%>][lathe_worker]" class="form-control" value="<%=row['lathe_worker']%>" size="20"></td>
                <td><input type="text" name="row[<%=name%>][<%=index%>][driller_worker]" class="form-control" value="<%=row['driller_worker']%>" size="20"></td>
                <td><textarea name="row[<%=name%>][<%=index%>][remark]" class="form-control"><%=row['remark']%></textarea></td>
                <td><span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span></td>
            </tr>
        </script>
    </div>



    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
